<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    
    <ul class="nav nav-tabs">
        <li class="active"><a href="#info_nav" data-toggle="tab" aria-expanded="true">基本信息</a></li>
        <li class=""><a href="#item_nav" data-toggle="tab" aria-expanded="false">套餐产品</a></li>
        <li class=""><a href="#body_nav" data-toggle="tab" aria-expanded="false">图文详情</a></li>
    </ul>
    <div style="height: 20px;width:100%;"></div>
    <div class="tab-content">
        <div class="tab-panel active" id="info_nav">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-name"  class="form-control" name="row[name]" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="radio">
                {foreach name="statusList" item="vo"}
                <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
                {/foreach}
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">有效期:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="radio">
                {foreach name="timeArea" item="vo"}
                <label for="row[time_area]-{$key}"><input id="row[time_area]-{$key}" name="row[time_area]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
                {/foreach}
                </div>
                <div style="font-size: 13px;color:#888;">*从用户购买日起算</div>
            </div>
        </div>
    
      
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">参与会员折扣:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="radio">
                    {foreach name="yesNoList" item="vo"}
                        <label for="row[vip_discount]-{$key}"><input id="row[vip_discount]-{$key}" name="row[vip_discount]" type="radio" value="{$key}" {in name="key" value="2"}checked{/in} /> {$vo}</label> 
                    {/foreach}
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Anget')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="radio">
                    {foreach name="angetList" item="vo"}
                        <label for="row[anget]-{$key}"><input id="row[anget]-{$key}" name="row[anget]" type="radio" value="{$key}" {in name="key" value="2"}checked{/in} /> {$vo}</label> 
                    {/foreach}
                </div>
            </div>
        </div>
 
        <div class="form-group hidden" data-favisible="anget=1">
            <label class="control-label col-xs-12 col-sm-2">{:__('Anget_lev1')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group"  style="width: 130px;">
                    <input id="c-anget_lev1" data-rule="required" class="form-control" name="row[anget_lev1]" type="number" value="0">
                    <span class="input-group-addon">%</span>
                </div>
                <div style="font-size: 13px;color:#888;">*给消费者上级的返佣，比如金额100元，返佣10%，表示分出去10元</div>
            </div>
        </div>
        <div class="form-group hidden" data-favisible="anget=1">
            <label class="control-label col-xs-12 col-sm-2">{:__('Anget_lev2')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group " style="width: 130px;">
                    <input id="c-anget_lev2" data-rule="required" class="form-control" name="row[anget_lev2]" type="number" value="0">
                    <span class="input-group-addon">%</span>
                </div>
                <div style="font-size: 13px;color:#888;">*给消费者上上级的返佣，比如金额100元，返佣5%，表示分出去5元</div>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Img_images')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group">
                    <input id="c-img_images" class="form-control" size="50" name="row[img_images]" type="text">
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="faupload-img_images" class="btn btn-danger faupload" data-input-id="c-img_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-img_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        <span><button type="button" id="fachoose-img_images" class="btn btn-primary fachoose" data-input-id="c-img_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                    </div>
                    <span class="msg-box n-right" for="c-img_images"></span>
                </div>
                <div style="font-size: 13px;color:#888;">*第一张图将被选为封面图，拖动图片可以排序</div>
                <ul class="row list-inline faupload-preview" id="p-img_images"></ul>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Fake_sale_times')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-fake_sale_times" class="form-control" name="row[fake_sale_times]" type="number" value="0">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-weigh"  class="form-control" name="row[weigh]" type="number" value="">
            </div>
        </div>
      </div>
      <!-- /info_nav -->
      <div class="tab-panel " id="item_nav">

        <div class="form-group" style="margin:0 10px;">
            <div class="col-xs-24 col-sm-13">
                <dl  class="fieldlist" data-name="row[card_item]" data-template="tpl_card_item">
                    <dd class="form-inline header-box-title">
                        <ins style="width:180px">产品名称</ins>
                        <ins style="width:180px">规格名称</ins>
                        <ins style="width:100px">规格单位</ins>
                        <ins style="width:100px">原价</ins>
                        <ins style="width:100px">套餐单价</ins>
                        <ins style="width:80px">次数</ins>
                    </dd>
                    <dd class="form-inline" style="padding:10px;"><a href="javascript:;" data-urlpop="deerhome/items_gg/index?multiple=true" data-title="选择产品" class="btn btn-sm btn-success btn-appendItem"><i class="fa fa-plus"></i> 添加</a></dd>
                </dl>
                <textarea name="row[card_item]" class="form-control hide" cols="30" rows="5">[]</textarea>
                <!--定义模板，模板语法使用Art-Template模板语法-->
                <script type="text/html" id="tpl_card_item">
                    <dd class="form-inline">
                        <input type="hidden"  name="row[<%=name%>][<%=index%>][id]" class="form-control hide" value="<%=row['id']%>" size="30"/>
                        <input type="hidden"  name="row[<%=name%>][<%=index%>][hash]" class="form-control hide" value="<%=row['hash']%>" size="30"/>
                        <input type="text" style="width:180px" readonly name="row[<%=name%>][<%=index%>][name]" class="form-control" value="<%=row['name']%>" size="30"/>

                        <input type="text" style="width:180px" readonly name="row[<%=name%>][<%=index%>][gg]" class="form-control" value="<%=row['gg']%>" size="30"/>

                        <input type="text" style="width:100px" readonly name="row[<%=name%>][<%=index%>][dw]" class="form-control" value="<%=row['dw']%>" size="30"/>

                        <input type="number" readonly style="width:100px" name="row[<%=name%>][<%=index%>][price_market]" step="0.01" class="form-control" value="<%=row['price_market']%>" size="30"/>

                        <input type="number" style="width:100px" name="row[<%=name%>][<%=index%>][price]" step="0.01" class="form-control input_num" value="<%=row['price']%>" size="30"/>

                        <input type="text"  style="width:80px" name="row[<%=name%>][<%=index%>][num]" class="form-control input_num" value="<%=row['num']%>" />
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-trash-o"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </dd>
                </script>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">套餐{:__('Price_market')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-price_market" value="0"  readonly class="form-control" step="0.01" name="row[price_market]" type="number">
                <div style="font-size: 13px;color:#888;">*添加产品后自动计算</div>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">套餐{:__('Price')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-price" class="form-control" value="0" readonly name="row[price]" type="number">
                <div style="font-size: 13px;color:#888;">*添加产品后自动计算</div>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">产品页展示套餐:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="radio">
                {foreach name="yesNoList" item="vo"}
                <label for="row[item_show]-{$key}"><input id="row[item_show]-{$key}" name="row[item_show]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
                {/foreach}
                </div>
                <div style="font-size: 13px;color:#888;">*开启后将在套餐内的产品详情页面关联展示本套餐次卡</div>
            </div>
        </div>

      </div>
      <!-- /item_nav -->
      <div class="tab-panel" id="body_nav">
        <div class="form-group">
            <div class="col-xs-24 col-sm-10">
                <textarea id="c-body_con" class="form-control editor" rows="5" name="row[body_con]" cols="50"></textarea>
            </div>
        </div>
      </div>
      <!-- /body_nav -->
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
<style>
    .tab-content .tab-panel {
        display: none;
    }
    .tab-content .active {
        display: block;
    }
    .input-group > .msg-box.n-right{
        left: 130px;
    }
    .fieldlist{
        width: 860px;
        margin:0 auto;
        margin-bottom: 20px;
        background:#f9f9f9;
    }
    .fieldlist .form-inline.header-box-title ins{
        background-color: #f6f1ff !important;
        padding:5px;
    }
    .fieldlist .form-inline.header-box-title {
        background-color: #f6f1ff !important;
    }
    .fieldlist .form-inline {
        padding:0 5px;
    }
    .fieldlist .form-inline:nth-child(odd){
        background-color: #f6f1ff;
        padding:5px;
    }
</style>